import wepy from 'wepy'

const BASEURL = 'https://uinav.com/api/public/v1'

wepy.baseToast = function( title = '请求数据失败' ) {
  wepy.showToast({
    title: title,
    icon: 'none',
    duration: 2000
  }) 
}

wepy.get = function(url, data = {}) {
  return wepy.request({
    url: BASEURL + url,
    method: 'GET',
    data: data
  })
}

wepy.post = function(url, data = {}) {
  return wepy.request({
    url: BASEURL + url,
    method: 'POST',
    data: data
  })
}